.class public final Lcom/ninesky/browser/provider/downloads/s;
.super Ljava/lang/Object;


# instance fields
.field public A:Ljava/lang/String;

.field public volatile B:Z

.field private C:Ljava/lang/String;

.field private D:I

.field private E:Z

.field private F:I

.field private G:Ljava/util/Map;

.field private H:Lcom/ninesky/browser/provider/downloads/l;

.field private I:Landroid/content/Context;

.field public a:I

.field public b:Ljava/lang/String;

.field public c:Z

.field public d:Ljava/lang/String;

.field public e:Ljava/lang/String;

.field public f:Ljava/lang/String;

.field public g:I

.field public h:I

.field public i:I

.field public j:I

.field public k:I

.field public l:I

.field public m:I

.field public n:J

.field public o:Ljava/lang/String;

.field public p:Ljava/lang/String;

.field public q:Ljava/lang/String;

.field public r:Ljava/lang/String;

.field public s:Ljava/lang/String;

.field public t:J

.field public u:J

.field public v:Ljava/lang/String;

.field public w:Z

.field public x:Z

.field public y:Ljava/lang/String;

.field public z:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/ninesky/browser/provider/downloads/l;Landroid/database/Cursor;)V
    .locals 4

    const/4 v3, 0x0

    const/4 v2, 0x1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->G:Ljava/util/Map;

    iput-object p1, p0, Lcom/ninesky/browser/provider/downloads/s;->I:Landroid/content/Context;

    iput-object p2, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    const-string v0, "method"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    const-string v1, "_id"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->a:I

    const-string v1, "uri"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->b:Ljava/lang/String;

    const-string v1, "no_integrity"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    if-ne v1, v2, :cond_0

    move v1, v2

    :goto_0
    iput-boolean v1, p0, Lcom/ninesky/browser/provider/downloads/s;->c:Z

    const-string v1, "hint"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->d:Ljava/lang/String;

    const-string v1, "_data"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->e:Ljava/lang/String;

    const-string v1, "mimetype"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->f:Ljava/lang/String;

    const-string v1, "destination"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->g:I

    const-string v1, "visibility"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->h:I

    const-string v1, "control"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->i:I

    const-string v1, "status"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->j:I

    const-string v1, "numfailed"

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->k:I

    const v1, 0xfffffff

    and-int/2addr v1, v0

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->l:I

    shr-int/lit8 v0, v0, 0x1c

    iput v0, p0, Lcom/ninesky/browser/provider/downloads/s;->m:I

    const-string v0, "lastmod"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0

    iput-wide v0, p0, Lcom/ninesky/browser/provider/downloads/s;->n:J

    const-string v0, "notificationpackage"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->o:Ljava/lang/String;

    const-string v0, "notificationclass"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->p:Ljava/lang/String;

    const-string v0, "notificationextras"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->C:Ljava/lang/String;

    const-string v0, "cookiedata"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->q:Ljava/lang/String;

    const-string v0, "useragent"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->r:Ljava/lang/String;

    const-string v0, "referer"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->s:Ljava/lang/String;

    const-string v0, "total_bytes"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    int-to-long v0, v0

    iput-wide v0, p0, Lcom/ninesky/browser/provider/downloads/s;->t:J

    const-string v0, "current_bytes"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    int-to-long v0, v0

    iput-wide v0, p0, Lcom/ninesky/browser/provider/downloads/s;->u:J

    const-string v0, "etag"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->v:Ljava/lang/String;

    const-string v0, "scanned"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-ne v0, v2, :cond_1

    move v0, v2

    :goto_1
    iput-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->w:Z

    const-string v0, "is_public_api"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-eqz v0, :cond_2

    move v0, v2

    :goto_2
    iput-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->x:Z

    const-string v0, "allowed_network_types"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/provider/downloads/s;->D:I

    const-string v0, "allow_roaming"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    if-eqz v0, :cond_3

    move v0, v2

    :goto_3
    iput-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->E:Z

    const-string v0, "title"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->y:Ljava/lang/String;

    const-string v0, "description"

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {p3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->z:Ljava/lang/String;

    sget-object v0, Lcom/ninesky/browser/provider/downloads/g;->a:Ljava/util/Random;

    const/16 v1, 0x3e9

    invoke-virtual {v0, v1}, Ljava/util/Random;->nextInt(I)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/provider/downloads/s;->F:I

    iget v0, p0, Lcom/ninesky/browser/provider/downloads/s;->a:I

    int-to-long v0, v0

    invoke-direct {p0, v0, v1}, Lcom/ninesky/browser/provider/downloads/s;->a(J)V

    return-void

    :cond_0
    move v1, v3

    goto/16 :goto_0

    :cond_1
    move v0, v3

    goto :goto_1

    :cond_2
    move v0, v3

    goto :goto_2

    :cond_3
    move v0, v3

    goto :goto_3
.end method

.method private a(J)V
    .locals 6

    const/4 v2, 0x0

    sget-object v0, Lcom/ninesky/browser/provider/downloads/w;->a:Landroid/net/Uri;

    invoke-virtual {v0}, Landroid/net/Uri;->buildUpon()Landroid/net/Uri$Builder;

    move-result-object v0

    invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    const-string v1, "headers"

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;

    move-result-object v1

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->I:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    move-object v3, v2

    move-object v4, v2

    move-object v5, v2

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    :try_start_0
    const-string v1, "header"

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v1

    const-string v2, "value"

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v2

    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_0
    invoke-interface {v0}, Landroid/database/Cursor;->isAfterLast()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v3

    if-eqz v3, :cond_2

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->q:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->G:Ljava/util/Map;

    const-string v1, "Cookie"

    iget-object v2, p0, Lcom/ninesky/browser/provider/downloads/s;->q:Ljava/lang/String;

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->s:Ljava/lang/String;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->G:Ljava/util/Map;

    const-string v1, "Referer"

    iget-object v2, p0, Lcom/ninesky/browser/provider/downloads/s;->s:Ljava/lang/String;

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_1
    return-void

    :cond_2
    :try_start_1
    iget-object v3, p0, Lcom/ninesky/browser/provider/downloads/s;->G:Ljava/util/Map;

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    throw v1
.end method


# virtual methods
.method public final a()Ljava/util/Map;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->G:Ljava/util/Map;

    invoke-static {v0}, Ljava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;

    move-result-object v0

    return-object v0
.end method

.method public final a(Landroid/net/Uri;)V
    .locals 4

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->o:Ljava/lang/String;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->x:Z

    if-eqz v0, :cond_2

    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.DOWNLOAD_COMPLETE"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->o:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    const-string v1, "extra_download_id"

    iget v2, p0, Lcom/ninesky/browser/provider/downloads/s;->a:I

    int-to-long v2, v2

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;

    :goto_1
    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-interface {v1, v0}, Lcom/ninesky/browser/provider/downloads/l;->a(Landroid/content/Intent;)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->p:Ljava/lang/String;

    if-eqz v0, :cond_0

    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.DOWNLOAD_COMPLETED"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->o:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->C:Ljava/lang/String;

    if-eqz v1, :cond_3

    const-string v1, "notificationextras"

    iget-object v2, p0, Lcom/ninesky/browser/provider/downloads/s;->C:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    :cond_3
    const-string v1, "_data"

    invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    goto :goto_1
.end method

.method public final b()J
    .locals 5

    const/4 v4, 0x1

    iget v0, p0, Lcom/ninesky/browser/provider/downloads/s;->l:I

    if-lez v0, :cond_0

    iget-wide v0, p0, Lcom/ninesky/browser/provider/downloads/s;->n:J

    iget v2, p0, Lcom/ninesky/browser/provider/downloads/s;->l:I

    int-to-long v2, v2

    add-long/2addr v0, v2

    :goto_0
    return-wide v0

    :cond_0
    iget-wide v0, p0, Lcom/ninesky/browser/provider/downloads/s;->n:J

    iget v2, p0, Lcom/ninesky/browser/provider/downloads/s;->F:I

    add-int/lit16 v2, v2, 0x3e8

    mul-int/lit8 v2, v2, 0x1e

    iget v3, p0, Lcom/ninesky/browser/provider/downloads/s;->k:I

    sub-int/2addr v3, v4

    shl-int v3, v4, v3

    mul-int/2addr v2, v3

    int-to-long v2, v2

    add-long/2addr v0, v2

    goto :goto_0
.end method

.method public final c()Z
    .locals 7

    const/4 v6, 0x0

    const/4 v5, 0x1

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-interface {v0}, Lcom/ninesky/browser/provider/downloads/l;->b()Ljava/lang/Integer;

    move-result-object v0

    if-nez v0, :cond_0

    move v0, v6

    :goto_0
    return v0

    :cond_0
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    iget-boolean v1, p0, Lcom/ninesky/browser/provider/downloads/s;->x:Z

    if-eqz v1, :cond_1

    sparse-switch v0, :sswitch_data_0

    move v1, v6

    :goto_1
    iget v2, p0, Lcom/ninesky/browser/provider/downloads/s;->D:I

    and-int/2addr v1, v2

    if-nez v1, :cond_1

    move v0, v6

    :goto_2
    if-nez v0, :cond_7

    move v0, v6

    goto :goto_0

    :sswitch_0
    move v1, v5

    goto :goto_1

    :sswitch_1
    const/4 v1, 0x2

    goto :goto_1

    :sswitch_2
    const/4 v1, 0x4

    goto :goto_1

    :cond_1
    iget-wide v1, p0, Lcom/ninesky/browser/provider/downloads/s;->t:J

    const-wide/16 v3, 0x0

    cmp-long v1, v1, v3

    if-gtz v1, :cond_2

    move v0, v5

    :goto_3
    if-nez v0, :cond_6

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->I:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f070197

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->A:Ljava/lang/String;

    move v0, v6

    goto :goto_2

    :cond_2
    if-ne v0, v5, :cond_3

    move v0, v5

    goto :goto_3

    :cond_3
    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-interface {v0}, Lcom/ninesky/browser/provider/downloads/l;->d()Ljava/lang/Long;

    move-result-object v0

    if-nez v0, :cond_4

    move v0, v5

    goto :goto_3

    :cond_4
    iget-wide v1, p0, Lcom/ninesky/browser/provider/downloads/s;->t:J

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v3

    cmp-long v0, v1, v3

    if-gtz v0, :cond_5

    move v0, v5

    goto :goto_3

    :cond_5
    move v0, v6

    goto :goto_3

    :cond_6
    move v0, v5

    goto :goto_2

    :cond_7
    iget-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->x:Z

    if-eqz v0, :cond_8

    iget-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->E:Z

    :goto_4
    if-nez v0, :cond_a

    iget-object v0, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-interface {v0}, Lcom/ninesky/browser/provider/downloads/l;->c()Z

    move-result v0

    if-eqz v0, :cond_a

    move v0, v6

    goto :goto_0

    :cond_8
    iget v0, p0, Lcom/ninesky/browser/provider/downloads/s;->g:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_9

    move v0, v5

    goto :goto_4

    :cond_9
    move v0, v6

    goto :goto_4

    :cond_a
    move v0, v5

    goto :goto_0

    nop

    :sswitch_data_0
    .sparse-switch
        0x0 -> :sswitch_0
        0x1 -> :sswitch_1
        0x6 -> :sswitch_2
    .end sparse-switch
.end method

.method final d()V
    .locals 6

    const/4 v5, 0x0

    const/16 v1, 0xc0

    iget-boolean v0, p0, Lcom/ninesky/browser/provider/downloads/s;->B:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "Multiple threads on same download"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iget v0, p0, Lcom/ninesky/browser/provider/downloads/s;->j:I

    if-eq v0, v1, :cond_1

    iput v1, p0, Lcom/ninesky/browser/provider/downloads/s;->j:I

    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    const-string v1, "status"

    iget v2, p0, Lcom/ninesky/browser/provider/downloads/s;->j:I

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->I:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    sget-object v2, Lcom/ninesky/browser/provider/downloads/w;->a:Landroid/net/Uri;

    iget v3, p0, Lcom/ninesky/browser/provider/downloads/s;->a:I

    int-to-long v3, v3

    invoke-static {v2, v3, v4}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v1, v2, v0, v5, v5}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    :cond_1
    new-instance v0, Lcom/ninesky/browser/provider/downloads/q;

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->I:Landroid/content/Context;

    iget-object v2, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-direct {v0, v1, v2, p0}, Lcom/ninesky/browser/provider/downloads/q;-><init>(Landroid/content/Context;Lcom/ninesky/browser/provider/downloads/l;Lcom/ninesky/browser/provider/downloads/s;)V

    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/ninesky/browser/provider/downloads/s;->B:Z

    iget-object v1, p0, Lcom/ninesky/browser/provider/downloads/s;->H:Lcom/ninesky/browser/provider/downloads/l;

    invoke-interface {v1, v0}, Lcom/ninesky/browser/provider/downloads/l;->a(Ljava/lang/Thread;)V

    return-void
.end method
